package com.treasure.web.mapstruct;

import com.treasure.infrastructure.model.po.CorpEmailAccount;
import com.treasure.web.command.request.CorpEmailAccountEditRequest;
import com.treasure.web.command.response.CorpEmailAccountResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

/**
 * @author sunhongmin
 * @date 2023/11/17 22:38
 * @description
 */
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface CorpEmailAccountAssembler {
    CorpEmailAccountAssembler INSTANCE = Mappers.getMapper(CorpEmailAccountAssembler.class);

    CorpEmailAccountResponse convertToCorpEmailAccountResponse(CorpEmailAccount corpEmailAccount);

    void updateEmailAccount(@MappingTarget CorpEmailAccount corpEmailAccount, CorpEmailAccountEditRequest update);
}
